<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: red;
            top: 222px;
            left: 333px;
        }
    </style>
</head>
<body>
    <div></div>
    <script src="js/jquery-3.5.1.min.js"></script>
    <script>
        // 获得、设置元素在页面内的位置  toip left
        console.log($('div').offset());
        console.log($('div').offset().top);

        $('div').offset({
            top:0,
            left:0
        })
    </script>
</body>
</html>